package com.force.module.webserver.htmlast;

import lombok.Data;

import java.util.Arrays;
import java.util.List;

@Data
public class HtmlDom {

	private static String left="<";
	private static String slash="/";
	private static String right=">";

	public static String include(String content,boolean hasSlash){
		StringBuffer stringBuffer=new StringBuffer();
		stringBuffer.append(left);
		if(hasSlash){
			stringBuffer.append(slash);
		}
		stringBuffer.append(content);
		stringBuffer.append(right);
		return stringBuffer.toString();
	}

	public static String include(String... content){
		StringBuffer stringBuffer=new StringBuffer();
		stringBuffer.append(left);
		Arrays.stream(content).forEach(
				item->{
					stringBuffer.append(item);
					stringBuffer.append(" ");
				}
		);
		stringBuffer.append(right);
		return stringBuffer.toString();
	}

}
